// 管理这个项目的所有接口
import requset from "./requset"

// 请求首页数据
export const GetHomeData = () => requset.get("/index/index");

// 搜索框口数据
export const GetSearchPopupData = () => requset.get("/search/index");

// 实时搜索功能
export const GetSearchTipsListData = params => requset.get("/search/helper", { params });

// 搜索框商品搜索
export const GetGoodsListData = params => requset.get("/goods/list", { params });

// 清除历史记录
export const ClearHistory = () => requset.post("/search/clearhistory");

// 登录请求
export const GoLogin = params => requset.post("/auth/loginByWeb", params);

// 产品详情
export const GetGoodsDetailData = params => requset.get("/goods/detail", { params });

// 产品相关
export const GetGoodsRelatedData = params => requset.get("/goods/related", { params });

// 购物车中商品数量
export const GetGoodscount = () => requset.get("/cart/goodscount");

// 加入购物车
export const AddProductToCart = params => requset.post("/cart/add", params);

// 获取购物车数据
export const GetCartListData = () => requset.get("/cart/index");

//点击切换商品的选中状态
export const ChangeGoodchecked = params => requset.post("/cart/checked", params);

// 商品步进器
export const SeptterChangeData = params => requset.post("/cart/update", params);

// 删除商品
export const DeleteGood = params => requset.post("/cart/delete", params);

// export const GetHomeData = function(){
//   return axios.get("/index/index");
// }
